<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<title>医师首页</title>
		<%@ include file="/common/meta.jsp"%>
		<link rel="stylesheet" type="text/css" href="${ctx}/css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="${ctx}/css/home.css" />
		<link rel="stylesheet" type="text/css" href="${ctx}/css/docrhome.css" />
		<script type="text/javascript" src="${ctx}/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="${ctx}/js/home.js"></script>
		<script type="text/javascript" src="${ctx}/js/swfobject.js"></script>
	</head>
	<body>
		<%@ include file="/common/doctorHead.jsp"%>
		<div class="container clearfix">
			<div class="followinfo">
				<div class="userinfo">
					<dl class="user clearfix">
						<dt><img src="${ctx}/images/ys.jpg" alt="医生" width="60" height="60" /></dt>
						<dd>
							<h2>仓井医</h2>
							<p>中医大夫</p>
							<p>北京市VA中医会所特级老中医</p>
						</dd>
					</dl>
					<ul class="num clearfix">
						<li class="first">关注<a href=""><strong>38</strong></a></li>
						<li>被关注<a href=""><strong>201314</strong></a></li>
					</ul>
				</div>
			</div>
			<div class="main">
				<div class="talk"><a href="javascript:void(0);" onclick="submitTalk()">发布</a><textarea name="" id="mytalk" ></textarea></div>
				<dl id="newsmenu" class="news">
					<dt class="items clearfix">
						<a href="javascript:void(0)" rel="#all" class="selected">所有人</a>
						<a href="javascript:void(0)" rel="#doctor">医师</a>
						<a href="javascript:void(0)" rel="#user">用户</a>
						<a href="javascript:void(0)" rel="#tagnews">标签</a>
					</dt>
					<dd class="itemconts">
						<div id="all">
							<c:forEach items="${talkList}" var="list">
								<div class="talktalk">
									<div class="talker">
										<a href="javascript:void(0);"><img src="${ctx}/${list.headUrl}" alt="" width="50" height="50" class="head" /></a>
									</div>
									<div class="talkcont">
										<p><a href="javascript:void(0);">${list.name}</a>：${list.content}</p>
										<div class="extension">
											<div class="talktime"><span>${list.talkDate}</span></div>
										</div>
									</div>
								</div>
							</c:forEach>
						</div>
						<div id="doctor" class="hide">
							<div class="talktalk">
								<div class="talker">
									<a href="javascript:void(0);"><img src="${ctx}/images/jyw.jpg" alt="" width="50" height="50" class="head"/></a>
								</div>
								<div class="talkcont">
									<p><a href="javascript:void(0);">锦衣卫</a>：欧洲杯来了！我支持湖人队，因为我喜欢林丹，她跨栏那么厉害，基本不用抢七就能一杆清台的，她提拉弧旋球也很强，过弯很流畅，入水都没有水花的。最帅的是打小鸟球基本上不用背越式，直接跳发，托马斯全旋接一个全垒打，对方的四分卫就算是黑带也经常来不及使出盛装舞步就直接被将死</p>
									<div class="extension">
										<div class="talktime"><span>昨天&nbsp;24:01</span></div>
									</div>
								</div>
							</div>
						</div>
						<div id="user" class="hide">
							<div class="talktalk">
								<div class="talker">
									<a href="javascript:void(0);"><img src="${ctx}/images/lp.jpg" alt="" width="50" height="50" class="head"/></a>
								</div>
								<div class="talkcont">
									<p><a href="javascript:void(0);">老婆</a>：欧洲杯来了！我支持湖人队，因为我喜欢林丹，她跨栏那么厉害，基本不用抢七就能一杆清台的，她提拉弧旋球也很强，过弯很流畅，入水都没有水花的。最帅的是打小鸟球基本上不用背越式，直接跳发，托马斯全旋接一个全垒打，对方的四分卫就算是黑带也经常来不及使出盛装舞步就直接被将死</p>
									<div class="extension">
										<div class="talktime"><span>昨天&nbsp;24:01</span></div>
									</div>
								</div>
							</div>
						</div>
						<div id="tagnews" class="hide">
							<div class="talktalk">
								<div class="talker">
									<a href="javascript:void(0);"><img src="${ctx}/images/boss.jpg" alt="" width="50" height="50" class="head"/></a>
								</div>
								<div class="talkcont">
									<p><a href="javascript:void(0);">BOSS</a>：欧洲杯来了！我支持湖人队，因为我喜欢林丹，她跨栏那么厉害，基本不用抢七就能一杆清台的，她提拉弧旋球也很强，过弯很流畅，入水都没有水花的。最帅的是打小鸟球基本上不用背越式，直接跳发，托马斯全旋接一个全垒打，对方的四分卫就算是黑带也经常来不及使出盛装舞步就直接被将死</p>
									<div class="extension">
										<div class="talktime"><span>昨天&nbsp;24:01</span></div>
									</div>
								</div>
							</div>
						</div>
					</dd>
				</dl>
			</div>
			<div class="recommendinfo">
				<div class="diagnosis">
					<div class="diabtn clearfix">
						<a href="javascript:void(0);" id="register" class="reg left">开始挂号</a>
						<a href="javascript:void(0);" id="video" class="vid right">视频诊断</a>
					</div>
					<ul class="status">
						<li>今日挂号：<span>11</span></li>
						<li>今日已看：<span>1</span></li>
						<li>今日剩余：<span>10</span></li>
					</ul>
					<h3>等待队列：</h3>
					<ul class="queue">
						<div class="patient clearfix">
							<div class="patientpic left"><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" /></a></div>
							<div class="patientinfo left">
								<p>猥琐刘</p>
								<p>男，38岁，妇科</p>
							</div>
						</div>
						<div class="patient clearfix">
							<div class="patientpic left"><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" /></a></div>
							<div class="patientinfo left">
								<p>司徒雷登高望远</p>
								<p>男，28岁，妇科</p>
							</div>
						</div>
						<div class="patient clearfix">
							<div class="patientpic left"><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" /></a></div>
							<div class="patientinfo left">
								<p>淫荡成</p>
								<p>男，18岁，妇科</p>
							</div>
						</div>
						<div class="patient clearfix">
							<div class="patientpic left"><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" /></a></div>
							<div class="patientinfo left">
								<p>龙娇娇</p>
								<p>女，68岁，孕检</p>
							</div>
						</div>
						<div class="patient clearfix">
							<div class="patientpic left"><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" /></a></div>
							<div class="patientinfo left">
								<p>盖八方</p>
								<p>男，8岁，泌尿科</p>
							</div>
						</div>
					</ul>
				</div>
				<div class="mypatient">
					<div class="patientbf">
						<h2>我的病人</h2>
						<div class="attimg">
							<a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><a href="javascript:void(0);"><img src="${ctx}/images/cjz.jpg" alt="" class="head"/></a><span><a href="">更多&raquo;</a></span>
						</div>
					</div>
				</div>
				<div class="tipswrite">
					<div class="tips">
						<div class="tip">
							<div class="tiptitle clearfix">
								<h2>健康小贴士</h2>
								<a href="#">写贴士</a>
							</div>
							<div class="tipcontent">
								<p>反正就是一些小贴士啦，健康相关你懂的，人写的，还要搞什么审核来着是吧？当然作为医生的话也是可以参考参考的，做医生也各有所长嘛，不可能让骨伤科的写出养生方面的东东，难道他要写不要打架？其次多参考参考别人写的自己的文字水平才可以有提升啊，对吧？</p>
								<p class="tipwriter">——<a href="#">阿猫阿狗</a></p>
								<p><a href="#">阅读更多&raquo;</a></p>
							</div>
						</div>
					</div>
				</div>
				<div class="taginfo">
					<h2>关注的标签</h2>
					<div id="tags" class="tags clearfix">
						<div class="tag"><a href="#" class="tagname">养生</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">中医</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">西医</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">保健</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">中西医</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">减肥</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">医疗器械</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">药品质量</a><a href="javascript:void(0)" class="close">×</a></div>
						<div class="tag"><a href="#" class="tagname">针灸</a><a href="javascript:void(0)" class="close">×</a></div>
					</div>
				</div>
				<div class="hottaginfo">
					<h2>热门标签</h2>
					<p id="cloud">
						<a href="#">养生</a><a href="#">中医</a><a href="#">西医</a>
						<a href="#">保健</a><a href="#">中西医</a><a href="#">减肥</a>
						<a href="#">医疗器械</a><a href="#">药品质量</a><a href="#">针灸</a>
					</p>
					<script type="text/javascript">
						var cloud = new SWFObject("${ctx}/js/tagcloud.swf", "cloud", "180", "180", "9", "transparent");
						var content = '<tags><a href="http://www.baidu.com" style="font-size:8px;">养生</a><a href="#" style="font-size:10px;">中医</a><a href="#" style="font-size:14px;">西医</a><a href="#" style="font-size:20px;">保健</a><a href="http://google.com" style="font-size:13px;">中西医</a><a href="#" style="font-size:20px;">减肥</a><a href="#" style="font-size:20px;">医疗器械</a><a href="#" style="font-size:9px;">药品质量</a><a href="#" style="font-size:17px;">针灸</a></tags>';
						cloud.addParam("wmode", "transparent");
						cloud.addParam("allowScriptAccess", "always");
						cloud.addVariable("tcolor", "0xFFFFFF");
						cloud.addVariable("tcolor2", "0xFFFFFF");
						cloud.addVariable("hicolor", "0x999999");
						cloud.addVariable("tspeed", "150");
						cloud.addVariable("distr", "true");
						cloud.addVariable("mode", "tags");
						cloud.addVariable("tagcloud",encodeURIComponent(content));
						cloud.write("cloud");
					</script>
				</div>
				<div class="visitor">
					<dl id="recentvis">
						<dt class="vistab clearfix">
							<a href="javascript:void(0)" rel="#rencentvr" class="selected">最近访客</a><a href="javascript:void(0)" rel="#rencentgt">最近访问</a>
						</dt>
						<dd class="viscont">
							<div id="rencentvr" class="clearfix">
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="50" height="50" /></a>
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="50" height="50" /></a>
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="50" height="50" /></a>
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="50" height="50" /></a>
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="50" height="50" /></a>
							</div>
							<div id="rencentgt" class="hide clearfix">
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="35" height="35" /></a>
								<a href="#"><img src="${ctx}/images/fk.jpg" alt="zm" width="35" height="35" /></a>
							</div>
						</dd>
					</dl>
				</div>
			</div>
			<%@ include file="/common/foot.jsp"%>
		</div>
		<div class="card" id="ucard">
			<div class="perins">
				<img src="" alt="" />
				<p class="c-name"><a href="javascript:void(0);">name</a></p>
				<p class="c-instr">summary</p>
				<p class="c-att">
					<span>被关注:<b>21</b></span><span>关注:<b>121</b></span>
				</p>
			</div>
			<div class="perfun">
				<a href="" class="attention">guanzhu</a>
			</div>
		</div>
		<!-- For video pop-up layer -->
		<div class="videocover" id="videolayer">
			<div class="videoborder">
				<div class="videoframe clearfix">
					<a href="javascript:void(0)" id="close">×</a>
					<div class="talkside left">
						<div class="history" id="history">
							<dl>
								<dt>甘斌 2012-06-24 17:20:17</dt>
								<dd>↓↓↓一个淫荡的名字即将出现在这里</dd>
							</dl>
							<dl>
								<dt>陈国文 2012-06-24 17:20:18</dt>
								<dd>大妈在不？</dd>
							</dl>
							<dl>
								<dt>陈国文 2012-06-24 17:20:24</dt>
								<dd>…………尼玛甘斌</dd>
							</dl>
						</div>
						<div class="hr"></div>
						<div class="content" contenteditable="true" id="sendcontent">
							<!--<textarea name="" id="rcontent"></textarea>-->
						</div>
						<div class="send">
							<a href="javascript:void(0)" class="right">发送</a>
							<a href="javascript:void(0)" class="right" id="closebtn">关闭</a>
						</div>
					</div>
					<div class="videoside left">
						<div class="videos">
							<div class="other"></div>
							<div class="self"></div>
						</div>
						<div class="functions">
							<ul class="clearfix">
								<li>
									<div class="audiocontrol">
										<div class="total">
											<div class="current" id="percent"></div>
											<div href="javascript:void(0)" class="control" id="control"></div>
										</div>
									</div>
								</li>
								<li><a href="javascript:void(0)" class="fubtn">病例</a></li>
								<li><a href="javascript:void(0)" class="fubtn">价格</a></li>
								<li><a href="javascript:void(0)" class="fubtn">开药</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<script type="text/javascript">
		$(document).ready(function(){
			// 点击按钮暂停开始
			$('#register').click(function(){
				($(this).text()=='暂停挂号')?$(this).text('开始挂号'):$(this).text('暂停挂号');
			});
			// 点击打开视频/聊天窗口
			$('#video').click(function(){
				$('#videolayer').fadeIn();
				$('#sendcontent').focus();
			});
			// 关闭窗口
			$('#closebtn, #close').click(function(){
				if(confirm('确定关闭视频诊断吗？')) {
					$('#videolayer').fadeOut();
				}
			});
			// 音量滚动(调节)效果
			var move = false;
			var x;
			$('#control').mousedown(function(e){
				x = e.pageX-parseInt($(this).css('left'));
				move = true;
				return false;
			});
			$(document).mousemove(function(e){
				if(move) {
					var _x = e.pageX - x;
					if(_x >= 0 && _x<=110) {
						$('#control').css({left : (_x/1.2)+'%'});
						$('#percent').css({width: (_x/1.2)+'%'});
					}
				}
			}).mouseup(function(){
				move = false;
			});
			
			// tab选项卡切换效果，统一格式：dl>(dt>a*N)+(dd>div*N)，a的rel属性等于#+div的id
			var tabs = function(event) {
				var target = $(this.rel);
				$(this).addClass(event.data.cls).siblings().removeClass(event.data.cls);
				$(target).show().siblings('div').hide();
				alert("nnnnnn");
			};
			$('#newsmenu>dt>a').bind('click',{cls:'selected'},tabs);
			
		});
		
		function submitTalk(){
			var content = $("#mytalk").val();
			if(content.length > 255) {
				alert("输入字数最多255");
			}
			if(content.length > 0 && content.length <= 255) {
				$.ajax({
					type: "POST",
					url:"../user/doctor-talk.html",
					data: {content:content},
					dataType: "json",
					success: function(jsonStr){
					    var json = $.parseJSON(jsonStr);
						var obj = "<div class='talktalk'>" +
					     				"<div class='talker'>" +
											"<a href='javascript:void(0);'><img src='${ctx}/" + json.headUrl + "' alt='' width='50' height='50' class='head' /></a>" +
										"</div>" +
										"<div class='talkcont'>" +
											"<p><a href='javascript:void(0);'>" + json.name + "</a>：" + json.content + "</p>" +
											"<div class='extension'>" +
												"<div class='talktime'>" + 
													"<span>" + json.talkDate + "</span></div>"+
												"</div>" +
											"</div>" +
									"</div>";
					     $("div[id=all]").prepend(obj);
					     $("#mytalk").val("");
					}
				});
			}
		}
		
		setInterval(freshTalkCount,15000);// 定时请求服务器
		
		function freshTalkCount(){// 向服务器查询有多少条新发布的说说
			$.ajax({
				type: "POST",
				url:"../user/doctor-fresh-talk-count.html",
				dataType: "json",
				success: function(jsonStr) {
					if(jsonStr != 0){
						alert("有" + jsonStr + "条新说说");
					}
				}
			});
		}
		
		function getFreshTalk(){// 用于点击以后，浏览器向服务器请求新发布的说说
			$.ajax({
				type: "POST",
				url:"../user/doctor-fresh-talk.html",
				dataType: "json",
				success: function(jsonStr) {
				    alert(jsonStr);
				    var json = $.parseJSON(jsonStr);
				    alert(json[0]);
				}
			});
		}
		
		
		
		
		
		
		
		</script>
	</body>
</html>